/**
 * 脚手架demo文件
 */
import request from '@/utils/request';

export function login(data) {
  return request({
    url: '/api/user/login',
    method: 'post',
    data: data
  });
}

export function getImgCode(data) {
  return request({
    url: '/api/forget-password/getPicCode',
    method: 'get',
    params: data
  });
}

export function getPhoneCode(data) {
  return request({
    url: '/api/forget-password/phoneCodeSend',
    method: 'post',
    params: data
  });
}

export function phoneCodeValid(data) {
  return request({
    url: '/api/forget-password/phoneCodeValid',
    method: 'post',
    params: data
  });
}

export function loginLog(data) {
  return request({
    url: '/api/loginLog/searchListWithPage',
    method: 'get',
    params: data
  });
}

export function passwordReset(data) {
  return request({
    url: '/api/forget-password/passwordReset',
    method: 'post',
    params: data
  });
}

// 修改密码
export function updatePassword(data) {
  return request({
    url: '/api/userInfo/updatePassword',
    method: 'post',
    params: data
  });
}

// 查询个人中心
export function userCenterInfo(data) {
  return request({
    url: '/api/userInfo/userCenterInfo',
    method: 'get',
    params: data
  });
}

// 修改个人中心
export function updateUserCenter(data) {
  return request({
    url: '/api/userInfo/updateUserCenter',
    method: 'post',
    params: data
  });
}

export function getInfo(token) {
  return request({
    url: '/api/v1/user/info',
    method: 'get',
    params: { token }
  });
}

export function logout() {
  return request({
    url: '/api/v1/user/logout',
    method: 'post'
  });
}

export function getMyMenuTree() {
  return request({
    url: '/api/user/getUserMenuList',
    method: 'get'
  });
}
